Introduction

With the large number of blogging platforms available to users, it can be difficult to decide which one is best for your needs. Ghost is one of the easiest ways to quickly get a simple yet beautiful blog up and running quickly. Stack Harbor has made the process even easier by offering a turnkey Ghost application you can deploy with minimal configuration.

Configuring your Domain Name

Once you’ve spun up your stack, you’ll be able to access your Ghost Blog by pointing your browser to your Stack’s public IP address. However, you probably want people to be able to access your blog using a simple domain name, not your IP address. You should configure your domain name to point to your Stack’s IP address using whatever interface provided by your registrar.

Once you’ve set up your domain name to point to your server, you’ll need to inform the Ghost application and web server running on your stack of your domain name. SSH into your machine by running the following command:

ssh root@your_ip_address

If you haven’t set up your SSH keys, you’ll be prompted for a password. Then, we need to edit the config file located at /var/www/ghost. We’ll be using the nano text editor to edit the file.

nano /var/www/ghost/config.js

In this file, you’ll see a block labelled ‘production’ with some settings such as ‘url’ and ‘mail’. We’re interested in the ‘url’ setting. This is the url that Ghost uses when sending emails to users and also when linking to various pages on your blog. Change this to the domain name you’ve set up with us and press CTRL-O, return, and CTRL-X to save and exit.

Next, we need to inform the web server (nginx) of the domain name we’re going to be using. Once again we’ll use nano to edit the web server configuration file located at /etc/nginx/sites-available.

nano /etc/nginx/sites-available/ghost

You’ll see a line that says server_name localhost;. Change localhost to your domain name and press CTRL-O, return, and CTRL-X to save and exit. That’s it! Your Ghost application should be properly configured to allow the public to access your blog using the domain name you’ve configured with us. You’ll need to restart the Ghost application and the nginx web server to allow the changes to be introduced. Luckily its as simple as running the following two commands:

sudo service nginx restart
sudo service ghost restart

Final Words

Congratulations! You’re ready to start creating posts, adding users, and sharing your blog with the world. You should be able to access your blog using your domain name. To access the administrative dashboard, point your browser to http://your_domain_name/ghost.

If you find that your blog is quickly gaining traction and you need to scale your application, you can find tutorials on how to adapt in our Community Section. For anything related specifically to the Ghost platform, check out their terrific documentation. From all of us at Stack Harbor, ahoy!